package IOC.C2_resources.C2_3_resourcesImplementations.C2_3_4_resourcesImplementationsPathresource;

import org.junit.Test;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.PathResource;

/**
 * @author xufy
 * @version 1.0
 **/
public class PathResourceTest {

    @Test
    public void loadAndReadUrlResource() throws Exception {

        String path = "D:\\StudyProject\\spring-5.3.9-learning\\spring-core\\src\\main\\java\\IOC\\C2_resources\\C2_3_resourcesImplementations\\C2_3_1_resourcesImplementationsUrlresource\\books.xml";
        PathResource resource = new PathResource(path);
        // 获取文件名
        System.out.println("================ resource.getFileName = " + resource.getFilename());

    }
}
